#!/usr/bin/node

const Dog = require('./05-dog.js');
var taidi = new Dog('taidi', 4);
var qxc = new Dog('qxc', 9);

taidi.on('bark', onBark.bind(taidi));
qxc.on('bark', onBark.bind(qxc));

function onBark() {
  console.log('%s barked! energy: %s', this.name, this.energy);
}

